package com.DreamTeam.daoProxy;

import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;

import org.omg.CORBA_2_3.portable.OutputStream;

import com.DreamTeam.dao.IOrderMasterDao;
import com.DreamTeam.daoImpl.OrderMasterDao;
import com.DreamTeam.dbc.MySqlConnection;
import com.DreamTeam.po.OrderMaster;
import com.sun.corba.se.spi.ior.IOR;
import com.sun.corba.se.spi.ior.IORTemplateList;
import com.sun.corba.se.spi.ior.iiop.IIOPProfile;
import com.sun.corba.se.spi.orb.ORB;

public class OrderMasterDaoProxy implements IOrderMasterDao {
	private MySqlConnection conn;
	private IOrderMasterDao orderMasterDao;
	public OrderMasterDaoProxy(){
		conn = new MySqlConnection();
		orderMasterDao = new OrderMasterDao(conn.getConnection());
	}
	@Override
	public boolean doAdd(OrderMaster orderMaster) {
		boolean flag = false;
		flag = orderMasterDao.doAdd(orderMaster);
		conn.closeConnection();
		return flag;
	}

	@Override
	public boolean doDelete(OrderMaster orderMaster) {
		boolean flag = false;
		flag = orderMasterDao.doDelete(orderMaster);
		conn.closeConnection();
		return flag;
	}

	@Override
	public boolean doUpdate(OrderMaster orderMaster) {
		boolean flag = false;
		flag = orderMasterDao.doUpdate(orderMaster);
		conn.closeConnection();
		return flag;
	}

	@Override
	public List<OrderMaster> queryAll() {
		List<OrderMaster> list;
		list = orderMasterDao.queryAll();
		conn.closeConnection();
		return list;
	}

	@Override
	public List<OrderMaster> queryOrderMasterByColumn(String keyword,String columnName,String orderColumn,String model) {
		List<OrderMaster> list;
		list = orderMasterDao.queryOrderMasterByColumn(keyword, columnName, orderColumn, model);
		conn.closeConnection();
		return list;
	}
	@Override
	public List<OrderMaster> queryOrderByColumnName(String columnName,String model) {
		List<OrderMaster> list;
		list = orderMasterDao.queryOrderByColumnName(columnName,model);
		conn.closeConnection();
		return list;
	}
	@Override
	public List<OrderMaster> queryByKeyword(String keyword) {
		List<OrderMaster> list;
		list = orderMasterDao.queryByKeyword(keyword);
		conn.closeConnection();
		return list;
	}
	

	

}
